document.querySelector('.img__btn').addEventListener('click', function() {
    document.querySelector('.login-outside').classList.toggle('s--signup');
})


var cancle=document.querySelectorAll('.cancle');
var cover=document.querySelector('.cover');
var loginOutside=document.querySelector('.login-outside');


for(var i=0;i<cancle.length;i++){
    cancle[i].onclick=function(){
        cover.style.display='none';
        loginOutside.style.display='none';
    }
}


var eye1=document.querySelectorAll('.eye1');
var eye=document.querySelectorAll('.eye');
var pwd=document.querySelectorAll('.pwd');



    eye[0].addEventListener('click',function(){             /*for循环实在用不好，无奈用了笨方法*/
        eye[0].style.display='none';
        eye1[0].style.display='block';
        pwd[0].type='text';
    })

    eye1[0].addEventListener('click',function(){
        eye[0].style.display='block';
        eye1[0].style.display='none';
        pwd[0].type='password';
    })

 

    eye[1].addEventListener('click',function(){
        eye[1].style.display='none';
        eye1[1].style.display='block';
        pwd[1].type='text';
    })

    eye1[1].addEventListener('click',function(){
        eye[1].style.display='block';
        eye1[1].style.display='none';
        pwd[1].type='password';
    })

    



    var loginBtn=document.querySelector('.nav-login')
    var signBtn=document.querySelector('.nav-signin')   
    var subcont=document.querySelector('.sub-cont')
    var img=document.querySelector('.img')
    loginBtn.onclick=function(){     /*判断login-outside是否有类名s--signup，从而改变登录注册按钮点开之后的登录注册表单位置*/
        cover.style.display='block';
        loginOutside.style.display='block'
        if(loginOutside.className='login-outside s--signup'){
            loginOutside.classList.toggle('s--signup');
        }      
    };

    signBtn.onclick=function(){
        cover.style.display='block';
        loginOutside.style.display='block'
        if(loginOutside.className='login-outside'){
            loginOutside.classList.toggle('s--signup');
        }      
    };



